//
//  StrategyViewController.m
//  RENTVISITOR
//
//  Created by wonder on 2017/9/29.
//  Copyright © 2017年 UNN. All rights reserved.
//

#import "StrategyViewController.h"
#import "RentVieitor.h"

@interface StrategyViewController ()

@end

@implementation StrategyViewController

- (void)viewWillAppear:(BOOL)animated {
    
    self.navigationController.navigationBar.barTintColor = [UIColor whiteColor];
    self.navigationController.navigationBar.translucent = NO;
    self.navigationController.navigationBar.hidden = NO;
    self.tabBarController.tabBar.hidden = YES;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"租房攻略";
    self.view.backgroundColor = BackgroundColor;
    [self creatLeftView];
    
    
    UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0,0, KWidth, KHeight)];
    webView.backgroundColor = [UIColor whiteColor];
    NSString* path = [[NSBundle mainBundle] pathForResource:@"zufanggonglue" ofType:@"html"];
    NSURL* url = [NSURL fileURLWithPath:path];
    
    NSURLRequest* request = [NSURLRequest requestWithURL:url];
    [webView loadRequest:request];
    [self.view addSubview:webView];
}

- (void)creatLeftView {
    
    // 自定义导航栏左侧按钮
    UIButton * leftBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    leftBtn.frame = CGRectMake(-5, 0, 10, 15);
    [leftBtn setBackgroundImage:[UIImage imageNamed:@"箭头左"] forState:UIControlStateNormal];
    [leftBtn addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem * leftItem = [[UIBarButtonItem alloc] initWithCustomView:leftBtn];
    self.navigationItem.leftBarButtonItem = leftItem;
    
}

- (void)backAction {
    
    [self.navigationController popViewControllerAnimated:YES];
}

@end
